BlueCielo Meridian Enterprise 2013 Developer's Guide | BlueCielo ECM Solutions

Virtual property definitions in a search query

Private Sub Doit(ByVal dr As AMDocumentRepository)
    Dim ps As AMPropertySet
    Dim pd1 As AMPropertyDef
    Dim pd2 As AMPropertyDef
    Set ps = dr.Environment.PropertySets("AMContentSearchPropertySet")
    Set pd1 = ps.GetPropertyDefWithName("_SEARCHDOCUMENTCONTENT")    'only content of the document file
    'Set pd1 = ps.GetPropertyDefWithName("_SEARCHTEXTANDMEMOFIELDS") 'all text and memo properties
    'Set pd1 = ps.GetPropertyDefWithName("_SEARCHTEXTANDALLCONTENT") 'all text and memo properties and document content
    Set pd2 = ps.GetPropertyDefWithName("_SEARCHMEMOFIELDS")         'only memo properties
    Dim sq As AMSearchQuery
    Set sq = dr.NewSearchQuery
    sq.DisplayNameWildCard = "*.*"
    
    Dim pf1 As AMPropertyFilter
    Set pf1 = sq.NewPropertyFilter
    With pf1
        Set .Property = pd1     ' do not set it if you want to search in <All text properties>
        .Operator = OP_CONTAINS
        .Value = "Meridian"
    End With
    
    Dim pf2 As AMPropertyFilter
    Set pf2 = sq.NewPropertyFilter
    With pf2
        Set .Property = pd2
        .Operator = OP_CONTAINS
        .Value = dr.User
    End With
    Dim tv As AMTableViewROCollection
    Set tv = dr.ExecuteQuery(sq)
    
    Dim itv As IAMTableView
    Set itv = tv
    
    Dim vv As Variant
    vv = itv.GetMultipleRowColumns(0, -1)
End Sub

Copyright © 2000-2013 BlueCielo ECM Solutions